Skip to main content

PutResourceMetricRule

Description

call the PutResourceMetricRule interface to set threshold alarm rules for performance indicators of individual resources.

Request Method

POST

Request Path

/apsara/route/cms/PutResourceMetricRule

Request Parameters Common Parameters

NameLocationTypeRequiredSample valueDescription
NoEffectiveIntervalBODYstringNo00:00-06:00the non-effective time range of the alarm rule.
Escalations.Critical.ComparisonOperatorBODYstringNoGreaterThanOrEqualToThresholdCritical level threshold comparator. You can choose according to the following rules: GreaterThanOrEqualToThreshold: greater than or equal to GreaterThanThreshold: greater than LessThanOrEqualToThreshold: less than or equal to LessThanThreshold: less than NotEqualToThreshold: unequal GreaterThanYesterday: up from yesterday LessThanYesterday: down from yesterday GreaterThanLastWeek: up from the same time last week LessThanLastWeek: down from the same time last week GreaterThanLastPeriod: month-on-month increase LessThanLastPeriod: month-on-month decline
Escalations.Info.ComparisonOperatorBODYstringNoGreaterThanOrEqualToThresholdInfo level threshold comparator. You can choose according to the following rules: GreaterThanOrEqualToThreshold: greater than or equal to GreaterThanThreshold: greater than LessThanOrEqualToThreshold: less than or equal to LessThanThreshold: less than NotEqualToThreshold: unequal GreaterThanYesterday: up from yesterday LessThanYesterday: down from yesterday GreaterThanLastWeek: up from the same time last week LessThanLastWeek: down from the same time last week GreaterThanLastPeriod: month-on-month increase LessThanLastPeriod: month-on-month decline
RuleIdBODYstringYesa151cd6023eacee2f0978e03863cc1697c89508****alarm rule ID. Description is uniformly generated by the caller. If the alarm rule ID already exists, the alarm rule is modified. If the alarm rule ID does not exist, the alarm rule is created.
Escalations.Warn.TimesBODYintegerNo3Warn level alarm retries.
Escalations.Info.ThresholdBODYstringNo90Info level alarm threshold.
MetricNameBODYstringYescpu_totalmonitoring item name. description for details, please refer to main monitoring items of cloud products .
Escalations.Warn.StatisticsBODYstringNoAverageWarn level alarm statistics method.
Escalations.Warn.ComparisonOperatorBODYstringNoGreaterThanOrEqualToThresholdWarn level threshold comparator. You can choose according to the following rules: GreaterThanOrEqualToThreshold: greater than or equal to GreaterThanThreshold: greater than LessThanOrEqualToThreshold: less than or equal to LessThanThreshold: less than NotEqualToThreshold: unequal GreaterThanYesterday: up from yesterday LessThanYesterday: down from yesterday GreaterThanLastWeek: up from the same time last week LessThanLastWeek: down from the same time last week GreaterThanLastPeriod: month-on-month increase LessThanLastPeriod: month-on-month decline
EmailSubjectBODYstringNoan alarm occurredalarm mail rule subject.
RuleNameBODYstringYesmy alarm rulesthe display name of the alarm rule.
ContactGroupsBODYstringYesdefault alarm contact groupalarm contact group. description multiple contact groups are separated by English commas.
SilenceTimeBODYintegerNo86400channel silence period, in seconds, the default is 86400 seconds (1 day). description when the monitoring data continuously exceeds the alarm rule threshold, only one alarm notification will be sent in each silence period.
Escalations.Info.TimesBODYintegerNo3Info level alarm retries.
Escalations.Info.StatisticsBODYstringNoAverageInfo level alarm statistics method.
PeriodBODYstringNo60the aggregation period of monitoring data, in seconds, with a value of 60 or an integer multiple of 60. the default period is the original reporting period of monitoring data.
EffectiveIntervalBODYstringNo00:00-23:59the effective time range of the alarm rule.
versionBODYstringNo2016-01-01version of api
NamespaceBODYstringYesacs_ecs_dashboardthe data namespace of the product. description for details, please refer to main monitoring items of cloud products .
Escalations.Critical.StatisticsBODYstringNoAverageCritical level alarm statistics method.
Escalations.Warn.ThresholdBODYstringNo90Warn level alarm threshold.
regionIdBODYstringYesNo sample value for this parameter.region id
Escalations.Critical.TimesBODYintegerNo3Critical level alarm retries.
WebhookBODYstringNohttp://ww.aliyun.comcallback the specified URL address when the alarm occurs. Send a POST request to the URL.
ResourcesBODYstringYes[{"instanceId":"xxxxxxx"}]resources that require alarms. description for details, please refer to cloud product main monitoring item Dimensions information.
Escalations.Critical.ThresholdBODYstringNo90Critical level alarm threshold.
IntervalBODYstringNo60the detection period of the alarm rule, that is, how often does the alarm system check whether the alarm rule is triggered. The unit is seconds, which is the minimum frequency of the monitoring item by default. description for monitoring data frequency, please refer to DescribeMetricMetaList.

Return data

NameTypeSample valueDescription
Messagestringsuccesserror message.
RequestIdstring65D50468-ECEF-48F1-A6E1-D952E89D9436request ID.
Codestring200status code. description status code 200 indicates success.
Successbooleantruewhether the request was successful.

Example

Successful Response example

{
"Message":"success",
"RequestId":"65D50468-ECEF-48F1-A6E1-D952E89D9436",
"Code":"200",
"Success":"true"
}

Failed Response example

{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}

}